home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / haeberli / include / obj.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  108 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #include "bitmap.h"
  18. #include "image.h"
  19.  
  20. /* object types */
  21.  
  22. #define OBJ_POINTS    1
  23. #define OBJ_LINE    2
  24. #define OBJ_LOOP    3
  25. #define OBJ_POLYGON    4
  26.  
  27. #define OBJ_BEGINOBJ    4
  28. #define OBJ_ENDOBJ    5
  29. #define OBJ_CALLOBJ    6
  30.  
  31. #define OBJ_PUSHMATRIX    7
  32. #define OBJ_POPMATRIX    8
  33. #define OBJ_ROTATE    9
  34. #define OBJ_TRANSLATE    10
  35. #define OBJ_SCALE    11
  36.  
  37. /* point types */
  38.  
  39. #define PNT_SQUARE    1
  40. #define PNT_ROUND    2
  41.  
  42. typedef struct attribs {
  43.     float r, g, b;
  44.     float nx, ny, nz;
  45. } attribs;
  46.  
  47. typedef struct point {
  48.     struct point     *next;
  49.     int         type;
  50.     attribs        *attr;
  51.     float x, y, z;
  52. } point;
  53.  
  54. typedef struct object {
  55.        struct object     *next;
  56.     int         type;
  57.     attribs        *attr;
  58.     point         *points;
  59. } object;
  60.  
  61. /* vert object stuff */
  62.  
  63. #define VERTMAGIC    0x5423
  64.  
  65. typedef struct vert {
  66.     int r, g, b;
  67.     float x, y, z;
  68.     float nx, ny, nz;
  69. } vert;
  70.  
  71. #ifdef NOTDEF
  72. typedef struct mesh {
  73.     int xsize, ysize;
  74.     int xwrap, ywrap;
  75.     vert *verts;
  76. } mesh;
  77. #endif
  78.  
  79. /* fast object stuff */
  80.  
  81. #define FASTMAGIC    0x5423
  82.  
  83. typedef struct fastobj {
  84.     int npoints;
  85.     int colors;
  86.     int *data;
  87. } fastobj;
  88.  
  89. fastobj *readfastobj();
  90.  
  91. object *newobj();
  92. object *cloneobj();
  93. point *newpnt();
  94. point *clonepnt();
  95. attribs *newattr();
  96. attribs *cloneattr();
  97. point *findpoint();
  98. object *objfromfile();
  99. object *getobj();
  100. object *readobj();
  101. object *twixtobj();
  102. float getfloat();
  103. char *basename();
  104. float getparam();
  105. Bitmap *getbm();
  106. Font *getfnt();
  107. FILE *gfxopen();
  108.